/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
 * Description: 异构集合通信NPU侧notify
 */

#ifndef BARE_NOTIFY_H
#define BARE_NOTIFY_H

#include "notify_base.h"

namespace hccl {

class BareNotify : public NotifyBase {
public:
    BareNotify(NotifyType notifyType);
    BareNotify(NotifyType notifyType, HcclNotifyInfo notifyInfo);
    ~BareNotify();

    HcclResult Alloc() override;
    HcclResult Destroy() override;

    HcclResult Open() override;
    HcclResult Close() override;

    HcclResult Wait(Stream& stream, HcclDispatcher dispatcher, s32 stage, u32 timeOut) override;
    HcclResult Post(Stream& stream, HcclDispatcher dispatcher, s32 stage) override;

    HcclResult Wait(Stream& stream, HcclDispatcher dispatcher, s32 stage, u32 timeOut,
        u32 userRank, u32 remoteUserRank) override;
    HcclResult Post(Stream& stream, HcclDispatcher dispatcher, s32 stage,
        u32 remoteUserRank) override;

    HcclResult SetIpc() override;
    HcclResult Grant(s64 recvId) override;
    void Break() override;

private:

    bool isOpen{false};
    drvIpcNotifyInfo drvinfo;
};

}

#endif // BARE_NOTIFY_H